package com.spring.example.rocket;

/**
 * author: xiaochi
 * date: 2025/9/30
 */
// MessageSendResult.java
public class MessageSendResult {
    private boolean success;
    private String messageId;
    private String errorMsg;
    private Long costTime;

    // 快速创建成功结果的方法
    public static MessageSendResult success(String messageId) {
        MessageSendResult result = new MessageSendResult();
        result.setSuccess(true);
        result.setMessageId(messageId);
        return result;
    }

    public static MessageSendResult failure(String errorMsg) {
        MessageSendResult result = new MessageSendResult();
        result.setSuccess(false);
        result.setErrorMsg(errorMsg);
        return result;
    }

    // getter and setter...


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public Long getCostTime() {
        return costTime;
    }

    public void setCostTime(Long costTime) {
        this.costTime = costTime;
    }
}